<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
      <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta content="" name="description" />
    <meta content="webthemez" name="author" />
    <meta http-equiv="pragram" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache, must-revalidate">
    <meta http-equiv="expires" content="0">

    <title>Bootstrap Admin Template</title>
	<!-- Bootstrap Styles-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
     <!-- FontAwesome Styles-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
    <link href="assets/css/select2.min.css" rel="stylesheet" >
    <link href="assets/css/checkbox3.min.css" rel="stylesheet" >
        <!-- Custom Styles-->
    <link href="assets/css/custom-styles.css" rel="stylesheet" />
     <!-- Google Fonts-->
   <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
<div id="page-wrapper">

    <div class="header">
        <h1 class="page-header">
            课题审核
        </h1>

    </div>

        
            <div id="page-inner"> 
               
            <div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             课题列表
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline" role="grid">
                                    <div class="row"><div class="col-sm-6"><div class="dataTables_length" id="dataTables-example_length">
                                        <label>指导老师：
                                            <select name="teachers" id="teachers" aria-controls="dataTables-example" class="form-control input-sm">

                                            </select>
                                        </label>
                                        <label>课题来源：
                                            <select style="width: 200px" id="topicSrc">
                                                <option value="">全部</option>
                                                    <option value="A">结合教师科研</option>
                                                    <option value="B">结合生产实际</option>
                                                    <option value="C">结合实验</option>
                                                    <option value="D">结合实际背景的专题研究</option>
                                                    <option value="E">无实际背景的专题研究</option>
                                            </select>
                                        </label>
                                        <label>课题类别：
                                            <select style="width: 200px" id="topicType">
                                                <option value="">全部</option>
                                                    <option value="A">学术论文</option>
                                                    <option value="B">调查报告</option>
                                                    <option value="C">工程设计</option>
                                                    <option value="D">实验</option>
                                                    <option value="E">理论计算</option>
                                            </select>
                                        </label>
                                        <label>课题名称:<input type="search" id="topicName" class="form-control input-sm" aria-controls="dataTables-example"></label>
                                    </div></div><div class="col-sm-6"><div id="dataTables-example_filter" class="dataTables_filter">

                                        <label>
                                            <input type="button" class="btn btn-default" onclick="show(0)" value="查询">
                                        </label>
                                        </div></div></div><table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables" aria-describedby="dataTables-example_info">



                                    <thead>
                                        <tr role="row">
                                        <th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column ascending" style="width: 79.6667px;">课题名称</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 121.667px;">导师名</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 112.667px;">课题类别</th>
                                            <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 112.667px;">课题来源</th>
                                            <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 112.667px;">限制人数</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 43.6667px;">审核</th>
                                        </tr>
                                    </thead>
                                    <tbody id="data">
                                        

                                        </tbody>
                                </table>
                                    <div class="row">
                                        <div class="col-sm-6">
                                            <div class="dataTables_paginate paging_simple_numbers" id="dataTables-example_paginate">
                                                <div id="pageGro" >
                                                    <div id="pagelist">
                                                        <ul class="pagination">

                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>

        </div>
    </div>

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
            <h4 class="modal-title" id="myModalLabel">课题详情</h4>
            </div>
    <div class="modal-body">
    <div class="form-group">
        <label>课题名称：</label>
        <span id="topicNameq"></span>
    </div>
    <div class="form-group">
        <label>指导老师：</label>
          <span id="teacherName"></span>
    </div>
    <div class="form-group">
        <label>老师电话：</label>
        <span id="teacherPhone"></span>
    </div>
    <div class="form-group">
        <label>已选人数：</label>
        <span id="chosePerson"></span>
    </div>
     <div class="form-group">
         <label>限制人数：</label>
         <span id="limitPerson"></span>
     </div>
    <div class="form-group">
        <label>课题类别：</label>
        <span id="type"></span>
    </div>
     <div class="form-group">
         <label>课题来源：</label>
         <span id="src"></span>
     </div>
    <div class="form-group">
        <label>课题描述：</label>
        <span id="introduction"></span>
    </div>
    <div class="form-group">
        <label>选题要求：</label>
        <span id="requirement"></span>
    </div>
    <div class="form-group">
        <label>当前状态:</label>
        <span id="markedDel"></span>
     </div>
 </div>
 <div class="modal-footer">
  <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
  <button type="button" id="pass" class="btn btn-primary" data-dismiss="modal" onclick="pass()" key=""><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>通过</button>
  <button type="button" id="back" class="btn btn-primary" data-dismiss="modal" onclick="back()" gey=""><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>撤销通过</button>
 </div>
 </div>
 </div>
 </div>
<script type="text/javascript">
    var tmpid='';
    function showdialog(id) {
        var flag=Boolean('false');
        var re=getResponse('/topic/selectTopic/'+id);
        document.getElementById("topicNameq").innerHTML=re.responseJSON.topicName;
        document.getElementById("teacherName").innerHTML=re.responseJSON.teacherName;
        document.getElementById("teacherPhone").innerHTML=re.responseJSON.teacherTel;
        document.getElementById("chosePerson").innerHTML=re.responseJSON.chosePerson;
        document.getElementById("type").innerHTML=parseType(re.responseJSON.topicType);
        document.getElementById("introduction").innerHTML=re.responseJSON.introduction;
        document.getElementById("requirement").innerHTML=re.responseJSON.requirement;
        document.getElementById("src").innerHTML=parseSrc(re.responseJSON.topicSrc);
        document.getElementById("limitPerson").innerHTML=re.responseJSON.limitPerson;
        document.getElementById("markedDel").innerHTML=parseMarkedDel(re.responseJSON.markedDel);
        tmpid=id;
    }

    function pass() {
        var id=tmpid;
        var re=getResponse('/topic/passTopic/'+id+'/'+false);
        alert("通过成功！");
    }

    function back() {
        var id=tmpid;
        var re=getResponse('/topic/passTopic/'+id+'/'+true);
        alert("撤销成功！");
    }
</script>
     <!-- /. WRAPPER  -->
    <!-- JS Scripts-->
    <!-- jQuery Js -->
<script src="assets/js/jquery-1.10.2.js"></script>
      <!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
    <!-- Metis Menu Js -->
<script src="assets/js/jquery.metisMenu.js"></script>
      <!-- Custom Js -->

    <!--ajax-->
<script src="assets/js/jQuery-2.1.4.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/pageGroup.js"></script>
<script>

    var pageCount=0;
    var pageSize=8;
    var pageNum=0;
    var re=getResponse('/user/findTeacher');
    var tmp = '<option value="" selected="selected">全部</option>';
    for (var i = 0; i < re.responseJSON.length; i++) {
        tmp += '<option value='+re.responseJSON[i].id+'>'
            + re.responseJSON[i].realname + '</option>';
    }
    document.getElementById("teachers").innerHTML = tmp;
    show(pageNum);
    genPageList(pageCount,pageSize);
    function show(pageNum) {
        var teachersid=document.getElementById("teachers").value;
        var topicSrc=document.getElementById("topicSrc").value;
        var topicType=document.getElementById("topicType").value;
        var topicName=document.getElementById("topicName").value;
        var tablere=getResponse('/topic/listWithKeyMeta/8/'+pageNum,JSON.stringify({"teacherId":teachersid,"topicSrc":topicSrc,"topicType":topicType,"topicName":topicName}),"application/json");
        var tmp="";
        pageCount=tablere.responseJSON.count;
        pageSize=tablere.responseJSON.size;
        for(var i=0;i<tablere.responseJSON.objs.content.length;i++){
            if(i%2==0){
                tmp+="<tr class='gradeA odd'>";
                tmp+="<td class='sorting_1'>"+tablere.responseJSON.objs.content[i].topicName+"</td>"
                    +"<td class='center'>"+tablere.responseJSON.objs.content[i].teacherName+"</td>"
                    +"<td class='center'>"+parseType(tablere.responseJSON.objs.content[i].topicType)+"</td>"
                    +"<td class='center'>"+parseSrc(tablere.responseJSON.objs.content[i].topicSrc)+"</td>"
                    +"<td class='center'>"+tablere.responseJSON.objs.content[i].limitPerson+"</td>"
                    +"<td class='center'><a href='' class='btn btn-success' onclick='showdialog(\""+tablere.responseJSON.objs.content[i].id+"\")' data-toggle='modal' data-target='#myModal'>通过</a></td>"
                    +"</tr>";
            }
            else{
                tmp+="<tr class='gradeA even'>";
                tmp+="<td class='sorting_1'>"+tablere.responseJSON.objs.content[i].topicName+"</td>"
                    +"<td>"+tablere.responseJSON.objs.content[i].teacherName+"</td>"
                    +"<td>"+parseType(tablere.responseJSON.objs.content[i].topicType)+"</td>"
                    +"<td class='center'>"+parseSrc(tablere.responseJSON.objs.content[i].topicSrc)+"</td>"
                    +"<td class='center'>"+tablere.responseJSON.objs.content[i].limitPerson+"</td>"
                    +"<td class='center '><a href='' class='btn btn-success' onclick='showdialog(\""+tablere.responseJSON.objs.content[i].id+"\")' data-toggle='modal' data-target='#myModal'>通过</a></td>"
                    +"</tr>";
            }
        }
        document.getElementById("data").innerHTML=tmp;
    }



</script>
<script>
</script>

</body>
</html>
